package ABB;

import java.util.*;

public class Fanyi {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        Map<String, String> a = new HashMap<>();
        a.put("你", "ni");
        a.put("我", "wo");
        a.put("他", "ta");
        while (true) {
            System.out.println("请选择输入的语言 1.中译英 2英译汉");
            int n = in.nextInt();
            switch (n) {
                case 1:
                    System.out.println("请输入中文");
                    String chinese = in.next();
                    if (a.containsKey(chinese)) {
                        System.out.println(a.get(chinese));
                        break;
                    } else System.out.println("错误");
                    break;
                case 2:
                    System.out.println("请输入英语");
                    String english = in.next();
                    if (a.containsKey(english )) {
                        System.out.println(a.get(english ));
                        break;
            }

        }
    }
}
}
